<!--conf
<sample in_favorites="false">
               <product version="1.4" edition="std"/>
                       <modifications>
                               <modified date="070101"/>
                       </modifications>
               </sample>
 --> 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title>Multirow header</title>
	<link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxgrid.css">
	<script  src="../../codebase/dhtmlxcommon.js"></script>
	<script  src="../../codebase/dhtmlxgrid.js"></script>		
	<script  src="../../codebase/dhtmlxgridcell.js"></script>	
	
</head>

<body>
<link rel='STYLESHEET' type='text/css' href='../common/style.css'>
<table cellspacing="0" cellpadding="0" class="sample_header" border="0">
	<tr valign="middle">
		<!-- COMPONENT ICON -->
		<td width="40" align="center"><img src="../common/dhtmlxgrid_icon.gif" border="0"></td>
		<!-- COMPONENT NAME -->
		<td width="150" align="left" nowrap="true">Sample: dhtmlxGrid</td>
		<!-- SAMPLE TITLE -->
		<td width="0" align="left" nowrap><b>Multirow header</b></td>
		<!-- LINK TO COMPONENT PAGE -->
		<td width="0" align="right"><a href="http://www.dhtmlx.com/docs/products/dhtmlxGrid/index.shtml">dhtmlxGrid main page</a></td>
		<!-- CLOSE BUTTON -->
		<td width="50"><div class="sample_close"><a href="javascript:void(0);" onclick="self.close();"><img src="../common/sample_close.gif" width="14" height="14" border="0" alt="X"></a></div></td>
	</tr>
</table>
	
	
	<p>Setting multirow header with script</p>
	<div id="gridbox" width="600px" height="200px" style="background-color:white;"></div>
	
	<div><a href="javascript:void(0)" onclick='mygrid.attachHeader(["#rspan","Title","Author","#rspan","#rspan","#rspan","Bestseller","Published"]);mygrid.setSizes();'>Extend Header</a></div>

<div class='sample_code'><div class="hl-main"><pre><span class="hl-code"> 
    </span><span class="hl-comment">//</span><span class="hl-comment">add second row to header</span><span class="hl-comment"></span><span class="hl-code">
    </span><span class="hl-identifier">mygrid</span><span class="hl-code">.</span><span class="hl-identifier">attachHeader</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">#rspan,Title,Author,#rspan,#rspan,#rspan,Bestseller,Published</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-identifier">mygrid</span><span class="hl-code">.</span><span class="hl-identifier">setSizes</span><span class="hl-brackets">(</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-comment">//</span><span class="hl-comment">#rspan - include cell in rowspan</span><span class="hl-comment"></span><span class="hl-code">
    </span><span class="hl-comment">//</span><span class="hl-comment">#cspan - include cell in colspan</span><span class="hl-comment"></span></pre></div></div>	
	
Setting multirow header with XML (Professional Edition)
	<div id="gridbox2" width="600px" height="100px" style="background-color:white;"></div>
<div class='sample_code'><div class="hl-main"><pre><span class="hl-code"> 
    ...
    &lt;</span><span class="hl-identifier">head</span><span class="hl-code">&gt;
        &lt;</span><span class="hl-identifier">beforeInit</span><span class="hl-code">&gt;
            &lt;</span><span class="hl-identifier">call</span><span class="hl-code"> </span><span class="hl-identifier">command</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">attachHeader</span><span class="hl-quotes">&quot;</span><span class="hl-code">&gt;
                &lt;</span><span class="hl-identifier">param</span><span class="hl-code">&gt;#</span><span class="hl-identifier">rspan</span><span class="hl-code">,</span><span class="hl-identifier">Title</span><span class="hl-code">,</span><span class="hl-identifier">Author</span><span class="hl-code">,#</span><span class="hl-identifier">rspan</span><span class="hl-code">,#</span><span class="hl-identifier">rspan</span><span class="hl-code">,#</span><span class="hl-identifier">rspan</span><span class="hl-code">,</span><span class="hl-identifier">Bestseller</span><span class="hl-code">,</span><span class="hl-identifier">Published</span><span class="hl-code">&lt;/</span><span class="hl-identifier">param</span><span class="hl-code">&gt;
            &lt;/</span><span class="hl-identifier">call</span><span class="hl-code">&gt;
        &lt;/</span><span class="hl-identifier">beforeInit</span><span class="hl-code">&gt;    
        ...</span></pre></div></div>


<script>


	mygrid = new dhtmlXGridObject('gridbox');
	mygrid.setImagePath("../../codebase/imgs/");
    mygrid.setHeader("Sales,Book,#cspan,Price,In Store,Shipping,Other Info,#cspan");
	mygrid.setInitWidths("50,150,150,80,80,80,80,200")
	mygrid.setColAlign("right,left,left,right,center,left,center,center")
	mygrid.setColTypes("ed,ed,ed,price,ch,co,ra,ro");
    mygrid.getCombo(5).put(2,2);
	mygrid.setColSorting("int,str,str,int,str,str,str,str")
	mygrid.setColumnColor("white,#d5f1ff,#d5f1ff")
    mygrid.setColumnMinWidth(50,0);
	mygrid.init();
	mygrid.enableMultiselect(true)
	mygrid.loadXML("grid.xml");
	
	

</script>

<!-- FOOTER -->
<table callspacing="0" cellpadding="0" border="0" class="sample_footer"><tr><td style="padding-left: 8px;">&copy; <a href="http://www.dhtmlx.com">DHTMLX LTD</a>. All rights reserved</td></tr></table>
<!-- FOOTER -->

</body>
</html>
